package com.radar.io.radar346.DataType;

import com.radar.common.GisConstants;
import com.radar.io.radar346.Product382改;
import com.radar.utils.BitConverter;

public class VWPParser {
    Product382改 _this;

    public VWPParser(Product382改 product382改) {
        _this = product382改;
    }

    public void parse(byte[] bytes, int index, Product382改.RealFile header) throws Exception {
        int Layers = header.realObserSec.iLiTiSaoMiaoCengShu;
        _this.vwp = new VWP();
        _this.vwp.本产品所分析的高度个数 = BitConverter.toFloat(bytes, index);
        index += 4;
        _this.vwp.最大水平风速 = BitConverter.toFloat(bytes, index);
        index += 4;
        _this.vwp.最大水平风速风向 = BitConverter.toFloat(bytes, index);
        index += 4;
        _this.vwp.最大水平风速高度_KM = BitConverter.toFloat(bytes, index);
        index += 4;
        _this.vwp.体扫个数 = BitConverter.toFloat(bytes, index);
        index += 4;
        _this.vwp.距离 = BitConverter.toFloat(bytes, index);
        index += 4;
        _this.vwp.均方差阈值 = BitConverter.toFloat(bytes, index);
        index += 4;
        _this.vwp.对比性阈值 = BitConverter.toFloat(bytes, index);
        index += 4;
        _this.vwp.体扫时间 = new int[(int) _this.vwp.体扫个数];
        for (int i = 0; i < _this.vwp.体扫个数; i++) {
            _this.vwp.体扫时间[i] = BitConverter.toInt32(bytes, index);
            index += 4;
        }
        _this.vwp.高度 = new float[30];
        _this.vwp.风向 = new float[30];
        _this.vwp.风速 = new float[30];
        _this.vwp.均方根误差 = new float[30];
        for (int i = 0; i < 30; i++) {
            _this.vwp.高度[i] = BitConverter.toFloat(bytes, index);
            _this.vwp.风向[i] = BitConverter.toFloat(bytes, index + 120);
            _this.vwp.风速[i] = BitConverter.toFloat(bytes, index + 240);
            _this.vwp.均方根误差[i] = BitConverter.toFloat(bytes, index + 360);
            index += 4;
        }
    }
}
